package com.github.wj.security.server.domain;

import com.github.wj.security.server.entity.TSequence;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.transaction.annotation.Transactional;

/**
 * Created by wangjian on 2017/3/28.
 */
public interface SequenceRepository extends CrudRepository<TSequence,String> {

    @Transactional
    @Modifying
    @Query("update TSequence t set t.id=?1 where t.name=?2")
    int updateTSequenceByName(Long id, String name);
}
